{extend name="base/base-shop-layout"/}

{block name="linkCss"}
<link rel="stylesheet" href="__STATIC__/css/shop/shop.css">
<link rel="stylesheet" href="__STATIC__/css/shop/shop-form.css">
{/block}
{block name="linkScript"}
<script src="__STATIC__/js/uploadImgs.js"></script>
{/block}

{block name="breadcrumb"}
<a>商家管理中心</a>
<a> 店铺</a>
<a> 店铺设置</a>
{/block}

{block name="main"}
<div class="mlist">
    <div class="menu-bar">
        <ul>
            <li {eq name="op" value=""}class="active"{/eq}><a href="{:think\\Url::build('index')}">店铺设置</a></li>
            <li {eq name="op" value="slide"}class="active"{/eq}><a href="{:think\\Url::build('index','op=slide')}">幻灯片设置</a></li>
        </ul>
    </div>
    {if $op == ''}
    <div id="section1">
        <div class="setting-wrap">
            <div class="pannel-content">
                <form action="" class="layui-form">
                    <ul>
                        <li>
                            <div class="layui-form-item">
                                <label class="layui-form-label">店铺代码：</label>
                                <div class="layui-input-block">
                                    <p>jsgjzy1</p>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="layui-form-item">
                                <label class="layui-form-label">店铺名称：</label>
                                <div class="layui-input-block">
                                    <p>就手国际海外旗舰店</p>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="layui-form-item">
                                <label class="layui-form-label">店铺分类：</label>
                                <div class="layui-input-block">
                                    <p>母婴用品</p>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="layui-form-item">
                                <label class="layui-form-label">店铺等级：</label>
                                <div class="layui-input-block">
                                    <p>钻石店铺</p>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="layui-form-item">
                                <label class="layui-form-label">店铺logo：</label>
                                <div class="layui-inline">
                                    <div class="logo-wrap">
                                        <img src="__STATIC__/images/shop/default_logo.png" alt="">
                                    </div>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">&nbsp;</label>
                                <div class="layui-inline">
                                    <a id="uplogo" class="layui-btn upload"><i class="layui-icon">&#xe67c;</i>图片上传</a>
                                </div>
                                <div class="layui-block">
                                    <span class="tips">此处理店铺页logo；建议使用宽200像素-高60像素内的GIF或PNG透明图片；点击下方"确认提交"按钮后生效。</span>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="layui-form-item">
                                <label class="layui-form-label">首页Banner：</label>
                                <div class="layui-inline">
                                    <div class="banner-wrap">
                                        <img src="__STATIC__/images/shop/default_banner.png" alt="">
                                    </div>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">&nbsp;</label>
                                <div class="layui-inline">
                                    <a id="upbanner" class="layui-btn upload"><i class="layui-icon">&#xe67c;</i>图片上传</a>
                                </div>
                                <div class="layui-block">
                                    <span class="tips">此处为店铺页banner导航；建议使用宽1200像素*高150像素的图片；点击下方"确认提交"按钮后生效。</span>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="layui-form-item">
                                <label class="layui-form-label">二级域名：</label>
                                <div class="layui-inline">
                                    <input name="domain" placeholder="请输入二级域名" class="layui-input">
                                </div>
                                <div class="layui-inline">
                                    <span class="tips">可留空，域名长度应为: 2-15</span>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="layui-form-item">
                                <label class="layui-form-label">二维码：</label>
                                <div class="layui-inline">
                                    <div class="qrcode-wrap">
                                        <img src="__STATIC__/images/shop/qrcode.png" alt="">
                                    </div>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="layui-form-item">
                                <label class="layui-form-label">

                                </label>
                                <div class="layui-input-block">
                                    <button id="shoppost" class="layui-btn layui-btn-normal" lay-submit>确认提交</button>
                                </div>
                            </div>
                        </li>
                    </ul>
                </form>
            </div>
        </div>
    </div>
    {elseif $op == 'slide'/}
    <div id="section2">
        <div class="slide-wrap">
            <div class="upload-tips">
                <ul>
                    <li>1、最多可上传5张幻灯片图片。</li>
                    <li>2、支持jpg、jpeg、gif、png格式上传，建议图片宽度1200px、高度在300px到500px之间、大小1.00M以内的图片。提交2~5张图片可以进行幻灯片播放，一张图片没有幻灯片播放效果。</li>
                    <li>3、操作完成以后，按"提交"按钮，可以在当前页面进行幻灯片展示。</li>
                    <li>4、跳转链接必须带有<b style="color:red;">"http://"</b></li>
                </ul>
            </div>
            <div class="imgs-wrap">
                <form action="" class="layui-form">
                    <ul>
                        <li>
                            <div class="uw">
                                <div class="pic">
                                    <img src="__STATIC__/images/goods/nopic.png" alt="">
                                </div>
                                <div class="url">
                                    <p>跳转URL...</p>
                                    <input value="http://" name="slideurl[]" class="text" type="text">
                                </div>
                                <div class="ubtn">
                                    <a href="javascript:void(0)" class="layui-btn layui-btn-sm layui-btn-primary" id="up1"><i class="layui-icon">&#xe67c;</i>图片上传</a>
                                    <a class="layui-btn layui-btn-primary layui-btn-sm" href="javascript:void(0);">删除</a>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="uw">
                                <div class="pic">
                                    <img src="__STATIC__/images/goods/nopic.png" alt="">
                                </div>
                                <div class="url">
                                    <p>跳转URL...</p>
                                    <input value="http://" name="slideurl[]" class="text" type="text">
                                </div>
                                <div class="ubtn">
                                    <a href="javascript:void(0)" class="layui-btn layui-btn-sm layui-btn-primary" id="up2"><i class="layui-icon">&#xe67c;</i>图片上传</a>
                                    <a class="layui-btn layui-btn-primary layui-btn-sm" href="javascript:void(0);">删除</a>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="uw">
                                <div class="pic">
                                    <img src="__STATIC__/images/goods/nopic.png" alt="">
                                </div>
                                <div class="url">
                                    <p>跳转URL...</p>
                                    <input value="http://" name="slideurl[]" class="text" type="text">
                                </div>
                                <div class="ubtn">
                                    <a href="javascript:void(0)" class="layui-btn layui-btn-sm layui-btn-primary" id="up3"><i class="layui-icon">&#xe67c;</i>图片上传</a>
                                    <a class="layui-btn layui-btn-primary layui-btn-sm" href="javascript:void(0);">删除</a>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="uw">
                                <div class="pic">
                                    <img src="__STATIC__/images/goods/nopic.png" alt="">
                                </div>
                                <div class="url">
                                    <p>跳转URL...</p>
                                    <input value="http://" name="slideurl[]" class="text" type="text">
                                </div>
                                <div class="ubtn">
                                    <a href="javascript:void(0)" class="layui-btn layui-btn-sm layui-btn-primary" id="up4"><i class="layui-icon">&#xe67c;</i>图片上传</a>
                                    <a class="layui-btn layui-btn-primary layui-btn-sm" href="javascript:void(0);">删除</a>
                                </div>
                            </div>
                        </li>
                        <li>
                            <div class="uw">
                                <div class="pic">
                                    <img src="__STATIC__/images/goods/nopic.png" alt="">
                                </div>
                                <div class="url">
                                    <p>跳转URL...</p>
                                    <input value="http://" name="slideurl[]" class="text" type="text">
                                </div>
                                <div class="ubtn">
                                    <a href="javascript:void(0)" class="layui-btn layui-btn-sm layui-btn-primary" id="up5"><i class="layui-icon">&#xe67c;</i>图片上传</a>
                                    <a class="layui-btn layui-btn-primary layui-btn-sm" href="javascript:void(0);">删除</a>
                                </div>
                            </div>
                        </li>
                    </ul>
                </form>
            </div>
            <button class="layui-btn" id="post-slide" href="javascript:void(0)" lay-submit>提交</button>
        </div>
    </div>
    {/if}
</div>
{/block}

{block name="botScript"}
<script>
    layui.use(['form','upload'], function(){
        var form = layui.form;
        var upload = layui.upload;
        uploadLogo(upload);
        //表单验证
        form.verify({
            username: function(value, item){ //value：表单的值、item：表单的DOM对象
                if(!new RegExp("^[a-zA-Z\u4e00-\u9fa5\\s]+$").test(value)){
                    return '姓名不能有特殊字符';
                }else if(!/^[\S]{2,25}$/.test(value)){
                    return '姓名长度范围应在2到25之间';
                }
            }
        });
    });
</script>
{/block}
